package de.hauck.rtmidlet.model;

import java.util.Vector;

public class IBQueryBean {
	private Vector sellBeans = new Vector();
	private Vector buyBeans = new Vector();
	private double totalBuyAmount=0;
	private double totalSellAmount=0;
	private int totalBuyQuantity=0;
	private int totalSellQuantity=0;
	private double buyPrice=0;
	private double sellPrice=0;
	
	public IBQueryBean(Vector _sellBeans, Vector _buyBeans, double _totalBuyAmount, double _totalSellAmount,
			int _totalBuyQuantity, int _totalSellQuantity) {
		sellBeans=_sellBeans;
		buyBeans=_buyBeans;
		totalBuyAmount=_totalBuyAmount;
		totalSellAmount=_totalSellAmount;
		totalBuyQuantity=_totalBuyQuantity;
		totalSellQuantity=_totalSellQuantity;
	}
	 
	public Vector getSellBeans() {
		return sellBeans;
	}
	public void setSellBeans(Vector sellBeans) {
		this.sellBeans = sellBeans;
	}
	public Vector getBuyBeans() {
		return buyBeans;
	}
	public void setBuyBeans(Vector buyBeans) {
		this.buyBeans = buyBeans;
	}
	public double getTotalBuyAmount() {
		return totalBuyAmount;
	}
	public void setTotalBuyAmount(double totalBuyAmount) {
		this.totalBuyAmount = totalBuyAmount;
	}
	public double getTotalSellAmount() {
		return totalSellAmount;
	}
	public void setTotalSellAmount(double totalSellAmount) {
		this.totalSellAmount = totalSellAmount;
	}
	public int getTotalBuyQuantity() {
		return totalBuyQuantity;
	}
	public void setTotalBuyQuantity(int totalBuyQuantity) {
		this.totalBuyQuantity = totalBuyQuantity;
	}
	public int getTotalSellQuantity() {
		return totalSellQuantity;
	}
	public void setTotalSellQuantity(int totalSellQuantity) {
		this.totalSellQuantity = totalSellQuantity;
	}

	public double getBuyPrice() {
		return buyPrice;
	}

	public void setBuyPrice(double buyPrice) {
		this.buyPrice = buyPrice;
	}

	public double getSellPrice() {
		return sellPrice;
	}

	public void setSellPrice(double sellPrice) {
		this.sellPrice = sellPrice;
	}
	
	public String getBuyAmountAsString() {
		String ret=""+totalBuyAmount;
		int index=ret.indexOf(".");
		if (ret.length()>index+3) ret=ret.substring(0,index+3);
		else ret=ret+"0";
		return ret;
	}
	
	public String getSellAmountAsString() {
		String ret=""+totalSellAmount;
		int index=ret.indexOf(".");
		if (ret.length()>index+3) ret=ret.substring(0,index+3);
		else ret=ret+"0";
		return ret;
	}
	public String getBuyPriceAsString() {
		String ret=""+buyPrice;
		int index=ret.indexOf(".");
		if (ret.length()>index+5) ret=ret.substring(0,index+5);
		return ret;
	}
	public String getSellPriceAsString() {
		String ret=""+sellPrice;
		int index=ret.indexOf(".");
		if (ret.length()>index+5) ret=ret.substring(0,index+5);
		return ret;
	}	
}
